<?php
/**
 * Class Router
 * @package App\HttpController
 * Created by PhpStorm
 * User: shanshui
 * Date: 2020/3/17
 * Time: 14:20
 */
namespace App\HttpController;

use EasySwoole\Http\AbstractInterface\AbstractRouter;
use FastRoute\RouteCollector;



class Router extends AbstractRouter
{
    function initialize(RouteCollector $routeCollector)
    {
        //设置强制使用路由
        $this->setGlobalMode(false);

        $routeCollector->get('go','Index/tset');


        //api接口
        $routeCollector->addGroup('/api',function (RouteCollector $collector){
            //api接口
            //jwt测试接口
            $collector->get('/jwt', '/Api/Jwt/createJwt');
            //app 配置
            $collector->get('/example', '/Api/Example/getConfig');
            //会员注册登录
            $collector->post('/member/register', '/Api/Member/register');
            //会员退出登录
            $collector->get('/member/logout', '/Api/Member/logout');
            //会员详情
            $collector->get('/member/info', '/Api/Member/getInfos');
        });

    }
}

